package com.hkrt.arch


import android.arch.lifecycle.Lifecycle
import android.os.Bundle

import com.trello.rxlifecycle2.LifecycleTransformer

/**
 * @author chenjinguang
 * @date 20.05.2017
 */

interface BaseMVPContract {

    interface View {
        fun <T> getRxLifeCycle(): LifecycleTransformer<T>
    }

    interface Presenter<V : BaseMVPContract.View> {

        val stateBundle: Bundle

        val view: V

        val isViewAttached: Boolean

        fun attachLifecycle(lifecycle: Lifecycle)

        fun detachLifecycle(lifecycle: Lifecycle)

        fun attachView(view: V)

        fun detachView()

        fun onPresenterCreated()

        fun onPresenterDestroy()
    }
}
